<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>login</title>
    <link href="css/login.css" rel="stylesheet">
</head>

<body>
<div id="loginDiv" style="height: 400px">
    <form action="/OurWebsite/loginServlet" id="form">
        <h1 id="loginMsg">登录</h1>
        <div id="errorMsg">${login_msg} ${register_msg}</div>
        <p>账号:<input id="username" name="username" value="${cookie.username.value}" type="text" placeholder="输入用户名或邮箱"></p>
        <p>密码:<input id="password" name="password" value="${cookie.password.value}" type="password" placeholder="输入密码"></p>
        <p>验证码:<input id="code" name="code" type="text" placeholder="输入验证码"></p>
        <p>记住我:<input id="remember" name="remember" value="1" type="checkbox">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<img id="checkCodeImg" src="/OurWebsite/checkCodeServlet" onclick=""><a href="#" style="color: springgreen" id="changeImg">看不清？</a> </p>
        <div id="subDiv">
            <input type="submit" class="button" value="登录">
            <input type="reset" class="button" value="重置">&nbsp;&nbsp;&nbsp;
            <a href="register.jsp" style="color: springgreen">没有账号？</a>
        </div>
    </form>
    <div>
        <%--设置单击事件，更换验证码--%>
        <script>
            document.getElementById("changeImg").onclick = function (){

                document.getElementById("checkCodeImg").src = "/OurWebsite/checkCodeServlet?" + new Date().getMilliseconds();
            }

            document.getElementById("checkCodeImg").onclick = function (){

                document.getElementById("checkCodeImg").src = "/OurWebsite/checkCodeServlet?" + new Date().getMilliseconds();
            }

        </script>
    </div>
</div>

</body>
</html>